package com.example.entity;

import javax.persistence.*;
import java.time.LocalDateTime;

@Entity
@Table(name = "diagnostic_requests")
public class DiagnosticRequest {

    @Id
    @Column(name = "request_id")
    private String requestId;  // 诊断请求唯一标识

    @ManyToOne
    @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false)
    private User user;  // 用户ID，外键关联用户表

    @Column(name = "face_img", columnDefinition = "TEXT")
    private String faceImg;  // 面部图片Base64编码

    @Column(name = "tongue_img", columnDefinition = "TEXT")
    private String tongueImg;  // 舌苔图片Base64编码

    @Column(name = "main_corporeity")
    private String mainCorporeity;  // 初步诊断的体质结果

    @Column(name = "created_at", updatable = false)
    private LocalDateTime createdAt;  // 诊断请求时间

    @Column(name = "updated_at")
    private LocalDateTime updatedAt;  // 更新时间

    // Getters and Setters
    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getFaceImg() {
        return faceImg;
    }

    public void setFaceImg(String faceImg) {
        this.faceImg = faceImg;
    }

    public String getTongueImg() {
        return tongueImg;
    }

    public void setTongueImg(String tongueImg) {
        this.tongueImg = tongueImg;
    }

    public String getMainCorporeity() {
        return mainCorporeity;
    }

    public void setMainCorporeity(String mainCorporeity) {
        this.mainCorporeity = mainCorporeity;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }
}

